
#ifndef PROJECTZ_NUSER_NCOMMAND_CS_VEHICLE_EQUIP_H_
#define PROJECTZ_NUSER_NCOMMAND_CS_VEHICLE_EQUIP_H_

#include "../../engine.h"

#include "../../User.h"

#include "../../NLogic/Static.h"
#include "../../NLogic/Battle.h"

namespace ProjectZ { namespace NCommand { namespace NWorld {

class CS_VEHICLE_EQUIP
{
public:
	static void OnExecute(User * pUser, ::Network::Packet * pPacket)
	{
		NLogic::Space * pSpace = pUser->GetSpace();
		if (NULL == pSpace)
			return;

		PREPARE_PACKET;
//		Player_Info & player_info = pUser->player_info;

		int gid = 0;
		int state = 0;

		pPacket->ParseMsg("%d%c", &gid, &state);

		::Network::Packet * pNoti = ::Network::GETPACKETPOOL()->SEND_NEW();
		pNoti->Write4(gid);
		pNoti->Write1(state);
		pNoti->MakePacket(CMD_SN_VEHICLE_EQUIP);

		pSpace->SendAll(pNoti);

		//pUser->GetBattle()->GetData().vehicle_state = state;
		pUser->SetVehicleState(state);
	}
};

} /*NWorld*/ } /*NCommand*/ } /*ProjectZ*/


#endif /* PROJECTZ_NUSER_NCOMMAND_CS_VEHICLE_EQUIP_H_ */
